stages:
  - build
  - upload
  - deploy

build:
  stage: build
  script:
    - docker build -t lab8git:$CI_COMMIT_SHORT_SHA .

upload:
  stage: upload
  script:
    - kind load docker-image lab8git:$CI_COMMIT_SHORT_SHA

deploy:
  stage: deploy
  environment:
    name: production
  script:
    - kubectl create configmap lab8git-conf --from-file=manifest/ --namespace=default -o yaml --dry-run=client | kubectl apply -f -
    - kubectl set image deployment/lab8git-deployment lab8git=lab8git:${CI_COMMIT_SHORT_SHA}
